
import request from '@/utils/request'

/**
 * 获取部门列表数据
 * @returns
 */
export function getDepartmentsApi() {
  return request.get('/company/department')
}

/**
 * 获取部门负责人
 * @returns
 */
export function getManagerListApi() {
  return request.get('/sys/user/simple')
}
/**
 *新增部门
 * @param {*} data
 * @returns
 */
export function addDepartmentsApi(data) {
  return request.post('/company/department', data)
}

/**
 *获取部门详情
 * @param {*} id 部门id
 * @returns
 */
export function getDepartmentDetailApi(id) {
  return request.get(`/company/department/${id}`)
}
/**
 * 修改-部门详情
 * @param {*} data 要修改的表单数据
 * @returns
 */
export function updataDepartmentsApi(data) {
  return request.put(`/company/department/${data.id}`, data)
}

export function delDepartmentsApi(id) {
  return request.delete(`/company/department/${id}`)
}
